﻿
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<link href="~/Content/upshop/css/login.css" rel="stylesheet" />
@model App.Models.LoginViewModel
<form id="form1" name="" action="/login/index" method="post" enctype="multipart/form-data">
    @Html.ValidationSummary(true)
    <div class="xans-member-login ">
        <div class="login">
            <h3>member login</h3>
            <fieldset>
                <legend></legend>
                <label class="id">
                    <span>id</span>
                    @*<input id="member_id" name="member_id"  class="inputTypeText" value="" type="text" />*@
                    @Html.TextBoxFor(s => s.UserName, new { @maxlength = "50", @class = "inputTypeText" })
                    @Html.ValidationMessageFor(s => s.UserName)
                </label>
                <label class="password">
                    <span>password</span>
                    @*<input id="member_passwd" name="member_passwd" value="" type="password" />*@
                    @Html.PasswordFor(s => s.Password, new { @maxlength = "50" })
                    @Html.ValidationMessageFor(s => s.Password)

                </label>
                <p class="security">
                    <img src="/Content/upshop/images/ico_access.gif" alt="" /> 安全认证
                </p>
                <a href="javascript:void(0)" id="btnSumit"><img src="/Content/upshop/web/upload/plain/login-btn.jpg" alt="" /></a>
            </fieldset>
            <div class="loginlink">
                <ul>
                    <li><a href="/Regist/Index"><span>new member join us</span><span class="joinsum">new member join us</span></a></li>
                    @*<li><a href="/"><span>forgot your id?</span><span class="joinsum">아이디를 잊으셨나요?</span></a></li>
                        <li><a href="/"><span>forgot your password ?</span><span class="joinsum">비밀번호를 잊으셨나요?</span></a></li>*@
                </ul>
                @*<p class="link">비회원님도 상품구매가 가능합니다
                        <a href="" onclick="">
                            <img src="/Content/upshop/web/upload/plain/non-btn.jpg" alt="비회원구매" />
                        </a>
                    </p>*@
            </div>
        </div>
    </div>
    @Html.HiddenFor(s => s.ReturnUrl)
</form>

<script>
    $(function () {
        $("body").keydown(function () {
            if (event.keyCode == "13") {//keyCode=13是回车键
                if ($("#form1").valid()) {
                    $("#form1").submit();
                }
            }
        });
        $("#btnSumit").click(function () {
            if ($("#form1").valid()) {
                $("#form1").submit();
            }
        });
    })
</script>